<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<?PHP
if(!empty($_GET['email'])){$email=$_GET['email'];}else{$email='';}
if(!empty($_GET['signup_flag'])){$signup_flag=$_GET['signup_flag'];}else{$signup_flag=0;}
if(!empty($_GET['score_input_flag'])){$score_input_flag=$_GET['score_input_flag'];}else{$score_input_flag=0;}
?>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
        <meta name="description" content="" />
        <meta name="author" content="" />
        <style>
            body {
                font-family: 'Open Sans', sans-serif;
                line-height: 30px;
                background:url('assets/img/background13.jpg')no-repeat;
                height:100%;
                width:100%;
                overflow: hidden;
                background-size:cover;
            }
            .alp-div {
                filter:alpha(Opacity=80);
                -moz-opacity:0.5;
                opacity: 0.8;
                background-color: #000;
                color:#fff;
                text-align:left;
                padding: 20px;
                position: absolute;
                top: 100px;
                width:420px;
                height:300px;
                left:50%;
                top:50%; 
                margin-left:-210px;
                margin-top:-150px;
                border:1px solid #fff;
            }
            .button-center {
                margin-top: 10px;
                text-align:center;
            }
            .btn {
                width: 160px;
                height: 60px;
                font-size: 20px;
            }
            .btn-left{
                margin-right: 20px;
            }
            .btn-right{
                margin-left: 20px;
            }
            button:hover{
                color: #2945a5;
            }
        </style>
        <!--[if IE]>
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
            <![endif]-->
        <title>管理员登录</title>
        <!-- BOOTSTRAP CORE STYLE CSS -->

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <?PHP
        if($signup_flag==1){
        echo "<script>alert('注册成功');</script>";
        }elseif($score_input_flag==1){
        echo "<script>alert('成绩录入成功');</script>";
        }
        ?>
        <div class="alp-div">
            <form action="" name="admin_signin" method="post" >
                <div class="form-group">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="email" class="form-control" required="required" id="email" name="email" placeholder="email" value="<?PHP echo $email;?>"/>&nbsp;&nbsp;&nbsp;管理员邮箱<br /> 
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="password" class="form-control" required="required" id="password" name="password" placeholder="密码" />&nbsp;&nbsp;&nbsp;管理员密码<br /> 
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="number" class="form-control" id="site_number" name="site_number" oninput='if(value>3)value=3;if(value<1)value=1' placeholder="场地号" />&nbsp;&nbsp;&nbsp;场地号<br />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="number" class="form-control" id="rounds" name="rounds" oninput='if(value>3)value=3;if(value<1)value=1;if (document.getElementById("rounds").value != 1 && document.getElementById("session").value >=4)document.getElementById("session").value = 3;' placeholder="第几轮"/>&nbsp;&nbsp;&nbsp;轮次<br />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="number" class="form-control" id="session" name="session" oninput='if(value>4)value=4;if(value<1)value=1;if (document.getElementById("rounds").value != 1 && document.getElementById("session").value >=4)document.getElementById("session").value = 3;' placeholder="第几场"/>&nbsp;&nbsp;&nbsp;场次<br />
                </div>
                <div class="button-center">
                    <button class="btn btn-left" onclick="score_input()"/>比赛成绩录入</button>
                    <button class="btn btn-right" onclick="lottery()"/>抽签结果录入</button>
                </div>
                <center>
                <button class="btn" onclick="information_view()" style="width: 362px;margin-top:10px;"/>比赛信息总览</button>
                </center>
            </form>
        </div>


        <script type='text/javascript'>
            function score_input() {
                document.getElementById("site_number").required = true;
                document.getElementById("rounds").required = true;
                document.getElementById("session").required = true;
                document.admin_signin.action = "admin-signin.php?flag=0";
                document.admin_signin.submit();
            }
            function lottery() {
                document.getElementById("site_number").required = false;
                document.getElementById("rounds").required = false;
                document.getElementById("session").required = false;
                document.admin_signin.action = "admin-signin.php?flag=1";
                document.admin_signin.submit();
            }
            function information_view() {
                document.getElementById("site_number").required = false;
                document.getElementById("rounds").required = false;
                document.getElementById("session").required = false;
                document.admin_signin.action = "admin-signin.php?flag=2";
                document.admin_signin.submit();
            }
        </script>





    </body>
</html>
